#ifndef CHATINFOFRAME_H
#define CHATINFOFRAME_H

#include <QFrame>
#include <QGridLayout>
#include <QLabel>
#include <QPixmap>

class ChatInfoFrame : public QFrame {
    Q_OBJECT
   public:
    ChatInfoFrame(QString name, QWidget *parent = 0);
    ~ChatInfoFrame();
    //在线状态为真则头像外会有绿框
    void setOnlineStatus(bool status);
    //选中状态为真则会凹陷
    void setSelectedStatus(bool status);
    //设定显示的最新消息，自动截断
    void setLatestMessage(QString message);
    //消息有记号则最新消息会变红
    void setMessageMarked(bool status);
    std::vector<QFrame *> messageList;

    QString name;

   private:
    QLabel *userHead;
    QLabel *latestMessageLabel;

    bool FramePressed;
    void mousePressEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);
   signals:
    void clicked();
};

#endif  // CHATINFOFRAME_H
